#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	string s1;
	cin >> s1;
	reverse(s1.begin(),s1.end());
	cout << s1 <<endl;
	unsigned long r = stoll(s1,NULL,2); 
	cout << r << endl;
	cout << stoll(s1,NULL,2); 
	return 0;
} 


